|
| CuttingEdge.Conditions reference library |
| ValidatorExtensions..::.IsEmpty<(Of <(TCollection>)>) Method (ConditionValidator<(Of <(TCollection>)>)) |
| ValidatorExtensions Class See Also Send Feedback |
Checks whether the given value contains no elements. An exception is thrown otherwise. When the
value is a null reference it is considered empty.
Namespace:
CuttingEdge.Conditions
Assembly:
CuttingEdge.Conditions (in CuttingEdge.Conditions.dll)
Syntax
| Visual Basic (Declaration) |
|---|
Public Shared Function IsEmpty(Of TCollection As IEnumerable) ( _ validator As ConditionValidator(Of TCollection) _ ) As ConditionValidator(Of TCollection) |
| C# |
|---|
public static ConditionValidator<TCollection> IsEmpty<TCollection>( ConditionValidator<TCollection> validator ) where TCollection : IEnumerable |
| Visual C++ |
|---|
public: generic<typename TCollection> where TCollection : IEnumerable static ConditionValidator<TCollection>^ IsEmpty( ConditionValidator<TCollection>^ validator ) |
| JavaScript |
|---|
JavaScript does not support generic types or methods. |
Parameters
- validator
- Type: CuttingEdge.Conditions..::.ConditionValidator<(Of <(TCollection>)>)
The ConditionValidator<(Of <(T>)>) that holds the value that has to be checked.
Type Parameters
- TCollection
- The type of the value to check.
Return Value
The specified validator instance.
Exceptions
| Exception | Condition |
|---|---|
| System..::.ArgumentException | Thrown when the Value of the specified validator is not empty, while the specified validator is created using the Requires extension method. |
| CuttingEdge.Conditions..::.PostconditionException | Thrown when the Value of the specified validator is not empty, while the specified validator is created using the Ensures extension method. |